/******************************************************************************
*	usbd/usbd.h
*	 by Alex Chadwick
*
*	A light weight implementation of the USB protocol stack fit for a simple
*	driver.
*
*	usbd/usbd.h contains definitions relating to the generic USB driver. USB
*	is designed such that this driver's interface would be virtually the same
*	across all systems, and in fact its implementation varies little either.
******************************************************************************/
#ifndef _USBD_USBD_H
#define _USBD_USBD_H

#include <types.h>
#include <usbd/device.h>
#include <usbd/devicerequest.h>
#include <usbd/pipe.h>

Result  UsbInitialise (void) ;

Result  UsbGetDescriptor (UsbDevice* device, DescriptorTYPE type,
                          u8 index, u16 langId, void* buffer, u32 length,
                          u32 minimumLength, u8 recipient) ;

Result  UsbControlMessage (UsbDevice* device, UsbPipeAddress pipe,
                           void* buffer, u32 bufferLength,
                           UsbDeviceRequest* request, u32 timeout) ;

Result  UsbAllocateDevice (UsbDevice** device) ;

void  UsbDeallocateDevice (UsbDevice* device) ;

Result  UsbAttachDevice (UsbDevice* device) ;

const char*  UsbGetDescription (UsbDevice* device) ;

UsbDevice*  UsbGetRootHub (void) ;

void  UsbCheckForChange (void) ;

#endif // _USBD_USBD_H
